package com.woniuxy;

import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

import java.util.Date;

//测试jjwt
public class Test {
    public static void main(String[] args) {
        //基于后面的数据生成的加密串
        JwtBuilder jwtBuilder = Jwts.builder().setId("9527").setSubject("张三").setIssuedAt(new Date())
                //自定义信息
                .claim("mymoney",345543534)
                .claim("aaa","的撒旦撒旦")
                .signWith(SignatureAlgorithm.HS256, "woniuxy");
        System.out.println(jwtBuilder.compact());
    }
}
